package d1111.r214.num07;

public class Student {
    //成员变量
    private String name;
    private String number;

    public boolean equals(Object obj){
        Student stu=(Student)obj;
        if(this==stu){
            return true;
        }
       else if (this.name.equals(stu.name)&& this.number.equals(stu.number )){
            return true;
        } else{
            return false;
        }
    }

    public Student(String name, String number) {
        this.name = name;
        this.number = number;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }
    //重写的toString()方法
    @Override
    public String toString(){
        return "姓名是：" +this.name+ "  "+"学号是："+this.number;
    }
    /*public void say(){
        System.out.println(this.name+this.number);
    }

     */

}
